package com.toolbar;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private static final String TAG = "MainActivity";
    private Button btnSimpleToolbar;
    private Button btnCardView;
    private Button btnFloatActionButton;
    private Intent intent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btnSimpleToolbar = findViewById(R.id.btn_simple_toolbar);
        btnCardView = findViewById(R.id.btn_cardview);
        btnFloatActionButton = findViewById(R.id.btn_float_action);

        btnSimpleToolbar.setOnClickListener(this);
        btnCardView.setOnClickListener(this);
        btnFloatActionButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_simple_toolbar:
                intent = new Intent(MainActivity.this, toolbar.class);
                startActivity(intent);
                break;
            case R.id.btn_cardview:
                intent = new Intent(MainActivity.this, MyCardView.class);
                startActivity(intent);
                break;
            case R.id.btn_float_action:
                intent = new Intent(MainActivity.this, FloatingAction.class);
                startActivity(intent);
                break;
        }
    }
}
